<%@ page language="java" import="pos.domain.*,java.util.*" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>IntercambiosRecibidos</title>
<style type="text/css">
body {
	background-color:#4F4F4F
	
	
	
}
div {
	background-color:#CD5A24;
	margin-right:300px;
	margin-left: 200px;
	color: #333;
}
</style>
</head>
<body>
<img src= "http://www.thepropertyexchange.com.au/images/prop-header.png" /> 






<form action="FrontController?res=GestionarPeticionIntercambio.jsp" method="post">
<table summary ="Listado de Intercambios Recibidos" cellSpacing="1" cellPadding="8" width="770" align="center" border="0">
	<tr valign ="middle" align="center">
		<td  colspan="8"><b>Peticiones de Intercambio</b></td>
	</tr>
	<tr valign ="middle" align="center" id="cabecera">
		<td>&nbsp;</td><td>UsuarioQueOferta</td><td>CasaOfrecida</td><td>CasaAIntercambiar</td><td>FechaComienzoCasaOfrecida</td><td>FechaFinCasaOfrecida</td><td>FechaComienzoCasaAIntercambiar</td><td>FinFechaCasaAIntercambiar</td><td>Seleccionar</td>
	</tr>



<%
       ExchangeManager em= new ExchangeManager();
        HttpSession session1 = request.getSession(false);
		String email = (String) session.getAttribute("session.user");
       List<Exchange> exchanges = em.getExchangeReceiveds(email);
        for (Iterator<Exchange> iter = exchanges.iterator(); iter.hasNext();) {
            Exchange e = (Exchange) iter.next();
%>
		<tr>	
				<td>--</td>
				<td> <%=e.getEmailSent()%></td>
				<td> <%=e.getPropertySentID()%></td>
				<td> <%=e.getPropertyReceivedID()%></td>
				<td> <%=e.getStartDateSent()%></td>
				<td> <%=e.getEndDateSent()%></td>
				<td> <%=e.getStartDateReceived()%></td>
				<td> <%=e.getEndDateReceived()%></td>
				<td> <a href="FrontController?res=GestionarPeticionIntercambio.jsp?eid=<%=e.getExchangeID()%>"><img src='img/Intercambio.gif'> </a></td>
			</tr>
<%
        }
%>

</table>
</form>

<a href="FrontController?res=Principal.jsp?"><input type="button" value="ATRAS" name="ATRAS"></a>

</body>
</html>